/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.apache.metamodel.data;

import org.apache.metamodel.query.FilterItem;
import org.apache.metamodel.query.builder.FilterBuilder;
import org.apache.metamodel.schema.Column;

/**
 * An interface for builder components that formulate a WHERE clause, either for
 * querying, updating, deleting or other purposes.
 * 
 * @param <T>
 *            the return type of the {@link WhereClauseBuilder}s builder methods
 */
public interface WhereClauseBuilder<T> {

    /**
     * Defines a where item to set as a criteria
     * 
     * @param column
     *            a column to apply a criteria for
     * @return a builder object for further building the where item
     */
    public FilterBuilder<T> where(Column column);

    /**
     * Defines a where item to set as a criteria
     * 
     * @param columnName
     *            the name of the column to which the criteria will be applied
     * @return a builder object for further building the where item
     */
    public FilterBuilder<T> where(String columnName);

    /**
     * Applies where items to set criteria
     * 
     * @param filterItems
     *            the where items to set
     * @return the builder object itself, for further building of the update
     */
    public T where(FilterItem... filterItems);

    /**
     * Applies where items to set criteria
     * 
     * @param filterItems
     *            the where items to set
     * @return the builder object, for further building of the update
     */
    public T where(Iterable<FilterItem> filterItems);
}
